/*
Copyright (c) 2010 Andreas Bjerkeholt
License: MIT
http://www.opensource.org/licenses/mit-license.php
*/
#include "sound.h"
#include "sounds.h"

void playSound(uint8_t sound)
{
	if (configSound == CONFIG_SOUND_OFF)
		return;

	switch (sound)
	{
		case SOUND_CHIP:
			mixerSetSound(chack, chackSize, false);
			break;
		case SOUND_TICK:
			mixerSetSound(tick, tickSize, false);
			break;
		case SOUND_DOOR:
			if (configSound == CONFIG_SOUND_ON)
				mixerSetSound(door, doorSize, false);
			break;
		case SOUND_BOMB:
			mixerSetSound(bomb, bombSize, false);
			break;
		case SOUND_HITWALL:
			if (configSound == CONFIG_SOUND_ON)
				mixerSetSound(oof, oofSize, false);
			break;
		case SOUND_SOCKET:
			mixerSetSound(socket, socketSize, false);
			break;
		case SOUND_SPLASH:
			mixerSetSound(splash, splashSize, false);
			break;
		case SOUND_WIN:
			mixerSetSound(tada, tadaSize, false);
			break;
		case SOUND_TELEPORT:
			mixerSetSound(teleport, teleportSize, false);
			break;
		case SOUND_ITEM:
			mixerSetSound(ting, tingSize, false);
			break;
		case SOUND_BUTTON:
			mixerSetSound(click, clickSize, false);
			break;
		case SOUND_THIEF:
			if (configSound == CONFIG_SOUND_ON)
				mixerSetSound(thief, thiefSize, false);
			break;
	}
}
